import request from '@/config/axios'

export interface SchedulingVO {
  combinationApplyId: number // 拼团ID
  combinationName: string // 拼团名称
  coachUserId: number // 教练ID
  courseSchRecordReqVOS?: courseSchRecordReqVO[] // 排课时间列表
}

// 排课时间
export interface courseSchRecordReqVO {
  courseSchDate: string
  courseSchBegin: string
  courseSchEnd: string
}

// 查询排课列表
export const getSchedulingList = async (params: any) => {
  return await request.get({ url: '/system/course/scheduling/page', params })
}

// 新增排课
export const createScheduling = async (data: SchedulingVO) => {
  return await request.post({ url: '/system/course/scheduling/create', data })
}

// 编辑排课
export const updateScheduling = async (data: SchedulingVO) => {
  return await request.post({ url: '/system/course/scheduling/update', data })
}

// 获取排课时间
export const getCourseSch = async (combinationApplyId: number) => {
  return await request.get({ url: '/system/course/scheduling/getCourseSch/' + combinationApplyId })
}

// 获取拼团 孩子/家长 列表
export const getUserList = async (combinationApplyId: number) => {
  return await request.get({ url: '/system/course/scheduling/getUserList/' + combinationApplyId })
}
